package com.mcxx.handler;

import com.mcxx.aspect.annotation.BizTypeHandler;
import com.mcxx.constant.BusinessConstant;
import com.mcxx.modules.miniSalvation.order.service.read.StandardReadService;
import com.mcxx.modules.system.param.StandardParam;
import com.mcxx.result.BaseResult;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbean.Page;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;


@BizTypeHandler(handleType = BusinessConstant.SALV_STANDARD_QUERY)
public class SalvationStandardQueryHandler extends BizProcessHandler {
    @Autowired
    private StandardReadService standardReadService;

    @Override
    protected BaseResult preProccess(Map<String, Object> params) {
        System.out.println("preProcess");
        return BaseResult.success();
    }

    @Override
    protected BaseResult doProcess(Map<String, Object> params) {
        BaseResult result = new BaseResult();
        System.out.println("doProcess");
        StandardParam standardParam = (StandardParam)params.get("standardParam");
        String orgId = (String)params.get("orgId");
        PageParam pageParam = (PageParam)params.get("pageParam");
        Page page = standardReadService.getSalvationStandardList(standardParam, pageParam);
        return BaseResult.success(page);
    }
}
